function set_transform(obj, val){
	obj.style.transform = val;
	obj.style.webkitTransform = val;
}
unmove = true;
function run_tab(show_page){
	var startX = 0;
	var min = 0;
	var max = $(".site").length;
	var i_index = 0;
	var move_distance = 50;

	var div_width = $($(".site")[0]).width();
	$(".site").each(function(index){
		$(this).css("left", index*div_width);
	});
	
	$("#sites").on("touchstart", function(){
		if(event.targetTouches.length ==1){
			event.preventDefault();
			startX = event.targetTouches[0].pageX;
		}
	}).on("touchmove", function(){
		if(event.targetTouches.length ==1){
			event.preventDefault();
			if(!unmove){
				return true;
			}

			var touch = event.targetTouches[0];
			var diff = startX - touch.pageX;
			//console.log("diff="+diff);

			var move_right = diff > move_distance && i_index < max-1;
			var move_left = diff < -move_distance && i_index > min;

			if(move_right || move_left){
				unmove = false;
				if(move_right){
					i_index += 1;
				}else if(move_left){
					i_index -= 1;
				}
				move(i_index);
			}
		}
		return true;
	});

	show_page(0);
}